
#pragma once

#include "hid.h"
#include "usb_descriptor_common.h"
#define RAW_EPSIZE 32
#define CONSOLE_EPSIZE 32

enum {
    ITF_NUM_HID_KEYBOARD,
    ITF_NUM_HID_RAW,
    ITF_NUM_HID_MOUSE,
    ITF_NUM_HID_EXTRA,
    ITF_NUM_HID_CONSOLE,
    ITF_NUM_CDC,
    ITF_NUM_CDC_DATA,
#ifdef MIDI_ENABLE
    ITF_NUM_MIDI,
    ITF_NUM_MIDI_STREAMING,
#endif
    ITF_NUM_TOTAL
};

#define HID_REPORT_DESC_RAW() \
    HID_USAGE_PAGE_N(RAW_USAGE_PAGE, 2), \
    HID_USAGE(RAW_USAGE_ID), \
    HID_COLLECTION(HID_COLLECTION_APPLICATION), \
        HID_USAGE(0x62), \
        HID_LOGICAL_MIN(0x00), \
        HID_LOGICAL_MAX_N(0x00FF, 2), \
        HID_REPORT_COUNT(RAW_EPSIZE), \
        HID_REPORT_SIZE(0x08), \
        HID_INPUT(HID_DATA | HID_VARIABLE | HID_ABSOLUTE), \
        HID_USAGE(0x63), \
        HID_LOGICAL_MIN(0x00), \
        HID_LOGICAL_MAX_N(0x00FF, 2), \
        HID_REPORT_COUNT(RAW_EPSIZE), \
        HID_REPORT_SIZE(0x08), \
        HID_OUTPUT(HID_DATA | HID_VARIABLE | HID_ABSOLUTE | HID_NON_VOLATILE), \
    HID_COLLECTION_END

#define HID_REPORT_DESC_CONSOLE() \
    HID_USAGE_PAGE_N(0xFF31, 2), \
    HID_USAGE(0x74), \
    HID_COLLECTION(HID_COLLECTION_APPLICATION), \
        HID_USAGE(0x75), \
        HID_LOGICAL_MIN(0x00), \
        HID_LOGICAL_MAX_N(0x00FF, 2), \
        HID_REPORT_COUNT(CONSOLE_EPSIZE), \
        HID_REPORT_SIZE(0x08), \
        HID_INPUT(HID_DATA | HID_VARIABLE | HID_ABSOLUTE), \
        HID_USAGE(0x76), \
        HID_LOGICAL_MIN(0x00), \
        HID_LOGICAL_MAX_N(0x00FF, 2), \
        HID_REPORT_COUNT(CONSOLE_EPSIZE), \
        HID_REPORT_SIZE(0x08), \
        HID_OUTPUT(HID_DATA | HID_VARIABLE | HID_ABSOLUTE | HID_NON_VOLATILE), \
    HID_COLLECTION_END

uint8_t get_keyboard_led_status(void);
